package cn.edu.scnu.socialapp.utils;


import cn.edu.scnu.socialapp.model.entity.User;

public class UserThreadLocal {
    private UserThreadLocal(){}
    // 线程变量隔离
    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();
    public static void set(User user){
        LOCAL.set(user);
    }
    public static User get(){
        return LOCAL.get();
    }
    public static void remove(){
        LOCAL.remove();
    }

}
